import UIManager from "../UIManager";
import UIBase from "./UIBase";

const { ccclass, property } = cc._decorator;

@ccclass
export default class LevelInfo extends UIBase {

    @property(cc.Label)
    nowLevelLabel: cc.Label = null
    @property(cc.Label)
    nowItemsLabel: cc.Label = null

    private _uiManager: UIManager = null


    onLoad() {
        super.onLoad()
    }

    public init(uiManager: UIManager) {
        this._uiManager = uiManager
    }

    public setLevelLabel(level: number): void {
        // const levelChs = 
        const levelStr = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
        this.nowLevelLabel.string = `第${levelStr[level]}关`
    }

    public setItemsLabel(nowNum: number, allNum: number) {
        this.nowItemsLabel.string = `${nowNum}/${allNum}`
    }
}
